package com.hx.setting.action.request;

import com.hx.setting.action.request.BaseActionRequest;
import com.hx.setting.entity.Entity;
import com.hx.setting.model.RoleModel.ParentroleEnum;
import org.json.JSONObject;

/**
 * Generate Date : 2014-03-16
 * Generate Version : v3.0
 * Generate Name : Honey v3.1 Test
 * Generate User : THINK
 * JDK Version : 1.5
 */
public class RoleRequest extends BaseActionRequest implements Entity
{

	/** id */
	private Long			id;

	/** 角色名称 */
	private String			rolename;

	private ParentroleEnum	parentrole;

	/** 角色继承深度 */
	private Integer			depth;

	/** 是否允许角色继承 */
	private Short			allowassignedrecordsto;

	/** 
	 * 设定id
	 * @param id
	 */
	public void setId(Long id)
	{
		this.id = id;
	}

	/** 
	 * 获取id
	 * @return id
	 */
	public Long getId()
	{
		return this.id;
	}

	/** 
	 * 设定角色名称
	 * @param rolename
	 */
	public void setRolename(String rolename)
	{
		this.rolename = rolename;
	}

	/** 
	 * 获取角色名称
	 * @return 角色名称
	 */
	public String getRolename()
	{
		return this.rolename;
	}

	/** 
	 * 设定父角色继承(id:id:id)
	 * @param parentrole
	 */
	public void setParentrole(String parentrole)
	{
		this.parentrole = ParentroleEnum.getInstance( parentrole );
	}

	/** 
	 * 获取父角色继承(id:id:id)
	 * @return 父角色继承(id:id:id)
	 */
	public ParentroleEnum getParentrole()
	{
		return this.parentrole;
	}

	/** 
	 * 设定角色继承深度
	 * @param depth
	 */
	public void setDepth(Integer depth)
	{
		this.depth = depth;
	}

	/** 
	 * 获取角色继承深度
	 * @return 角色继承深度
	 */
	public Integer getDepth()
	{
		return this.depth;
	}

	/** 
	 * 设定是否允许角色继承
	 * @param allowassignedrecordsto
	 */
	public void setAllowassignedrecordsto(Short allowassignedrecordsto)
	{
		this.allowassignedrecordsto = allowassignedrecordsto;
	}

	/** 
	 * 获取是否允许角色继承
	 * @return 是否允许角色继承
	 */
	public Short getAllowassignedrecordsto()
	{
		return this.allowassignedrecordsto;
	}

	public Entity cloneEntity()
	{
		com.hx.setting.entity.RoleEntity answer = new com.hx.setting.entity.RoleEntity();
		Object obj = null;
		obj = this.getId();
		if ( obj != null )
		{
			answer.setId( this.getId() );
		}
		obj = this.getRolename();
		if ( obj != null )
		{
			answer.setRolename( this.getRolename() );
		}
		obj = this.getParentrole();
		if ( obj != null )
		{
			answer.setParentrole( this.getParentrole() );
		}
		obj = this.getDepth();
		if ( obj != null )
		{
			answer.setDepth( this.getDepth() );
		}
		obj = this.getAllowassignedrecordsto();
		if ( obj != null )
		{
			answer.setAllowassignedrecordsto( this.getAllowassignedrecordsto() );
		}
		return answer;
	}

	public JSONObject toJsonObject()
	{
		//禁止调用
		throw new RuntimeException( "禁止调用" );
	}

	public String toXml()
	{
		//禁止调用
		throw new RuntimeException( "禁止调用" );
	}
}
/* Honey v3.1 Test - version:4 - OriginalChecksum:B3b0fcd950205f60253b3f97be06e16a3 (do not edit this line) */
